set(GcmpPath "${GbmpThirdPart_GCMPSDK}")
include(CMakePrintHelpers)

if(NOT TARGET Gcmp::All)
    add_library(Gcmp::All IMPORTED SHARED GLOBAL)
    set_target_properties(Gcmp::All PROPERTIES
        #头文件路径
        INTERFACE_INCLUDE_DIRECTORIES "${GcmpPath}/include;${GcmpPath}/include/Gnuf"
        #导入库
        IMPORTED_IMPLIB "${GcmpPath}/lib/release/GcmpDevService.lib"
        #调试版本导入库
        IMPORTED_IMPLIB_DEBUG "${GcmpPath}/lib/debug/GcmpDevService.lib"        
        #输出文件位置
        IMPORTED_LOCATION "${GcmpPath}/bin/release/sdk/GcmpDevService.dll" 
        #调试版本输出文件位置
        IMPORTED_LOCATION_DEBUG "${GcmpPath}/bin/debug/sdk/GcmpDevService.dll"         
    )

    target_compile_definitions(Gcmp::All
        INTERFACE "_NOEXCEPT=noexcept"
    )

    #获取所有Release库并设置库依赖
    file(GLOB_RECURSE GCMPAllReleaseLibs
        LIST_DIRECTORIES False
        "${GcmpPath}/lib/release/*.lib"
    )
    list(REMOVE_ITEM GCMPAllReleaseLibs "${GcmpPath}/lib/release/cef_sandbox.lib")
    #cmake_print_variables(GCMPAllReleaseLibs)
    target_link_libraries(Gcmp::All INTERFACE
        "$<$<NOT:$<CONFIG:DEBUG>>:${GCMPAllReleaseLibs}>"
    )
    
    #获取所有debug库并设置库依赖
    file(GLOB_RECURSE GCMPAllDebugLibs
        LIST_DIRECTORIES False
        "${GcmpPath}/lib/debug/*.lib"
    )
    list(REMOVE_ITEM GCMPAllDebugLibs "${GcmpPath}/lib/debug/cef_sandbox.lib")
    #cmake_print_variables(GCMPAllDebugLibs)
    target_link_libraries(Gcmp::All INTERFACE
        "$<$<CONFIG:DEBUG>:${GCMPAllDebugLibs}>"
    )
endif()
